package com.gin.kotlin.vegetables_kot.database.entity

import android.os.Parcelable
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import kotlinx.parcelize.Parcelize
import java.time.ZonedDateTime

/**
 * 种菜日志
 * @property id Long
 * @property uuid String?
 * @property timeR 日志时间
 * @property timeO 操作时间
 * @property position 位置
 * @property typeV 蔬菜类型
 * @property typeO 操作类型
 * @property description 详细描述
 * @property images 图片地址
 * @constructor
 */
@Entity(
    indices = [
        Index(value = ["timeR", "position", "typeV", "typeO"]),
        Index(value = ["timeR", "typeV", "typeO"]),
        Index(value = ["timeR", "typeO"]),
        Index(value = ["uuid"], unique = true),
    ]
)
@Parcelize
data class VegetableLog(
    @PrimaryKey(autoGenerate = true)
    var id: Long,
    var uuid: String? = null,
    var timeR: ZonedDateTime? = null,
    var timeO: ZonedDateTime? = null,
    var position: String? = null,
    var typeV: String? = null,
    var typeO: String? = null,
    var description: String? = null,
    var images: List<String>? = null,
) : Parcelable
